package com.ruoyi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ZhwyNoticeMapper;
import com.ruoyi.domain.ZhwyNotice;
import com.ruoyi.service.IZhwyNoticeService;

/**
 * 业主通知公告Service业务层处理
 * 
 * @author zq
 * @date 2024-05-07
 */
@Service
public class ZhwyNoticeServiceImpl implements IZhwyNoticeService 
{
    @Autowired
    private ZhwyNoticeMapper zhwyNoticeMapper;

    /**
     * 查询业主通知公告
     * 
     * @param id 业主通知公告主键
     * @return 业主通知公告
     */
    @Override
    public ZhwyNotice selectZhwyNoticeById(Long id)
    {
        return zhwyNoticeMapper.selectZhwyNoticeById(id);
    }

    /**
     * 查询业主通知公告列表
     * 
     * @param zhwyNotice 业主通知公告
     * @return 业主通知公告
     */
    @Override
    public List<ZhwyNotice> selectZhwyNoticeList(ZhwyNotice zhwyNotice)
    {
        return zhwyNoticeMapper.selectZhwyNoticeList(zhwyNotice);
    }

    /**
     * 新增业主通知公告
     * 
     * @param zhwyNotice 业主通知公告
     * @return 结果
     */
    @Override
    public int insertZhwyNotice(ZhwyNotice zhwyNotice)
    {
        zhwyNotice.setCreateTime(DateUtils.getNowDate());
        return zhwyNoticeMapper.insertZhwyNotice(zhwyNotice);
    }

    /**
     * 修改业主通知公告
     * 
     * @param zhwyNotice 业主通知公告
     * @return 结果
     */
    @Override
    public int updateZhwyNotice(ZhwyNotice zhwyNotice)
    {
        return zhwyNoticeMapper.updateZhwyNotice(zhwyNotice);
    }

    /**
     * 批量删除业主通知公告
     * 
     * @param ids 需要删除的业主通知公告主键
     * @return 结果
     */
    @Override
    public int deleteZhwyNoticeByIds(Long[] ids)
    {
        return zhwyNoticeMapper.deleteZhwyNoticeByIds(ids);
    }

    /**
     * 删除业主通知公告信息
     * 
     * @param id 业主通知公告主键
     * @return 结果
     */
    @Override
    public int deleteZhwyNoticeById(Long id)
    {
        return zhwyNoticeMapper.deleteZhwyNoticeById(id);
    }
}
